home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CDsupport / IDer / Routines / BadDOS.s < prev    next >
Text File  |  1997-02-18  |  991b  |  27 lines

  1. BadDOS:    Lea    DOSLibrary(PC),A1    ;name of the library to open
  2.     Moveq    #0,D0        ;we need any version
  3.     CALL    OpenLibrary,EXEC    ;open the library
  4.     Move.L    D0,A6        ;don't bother with a variable as we only need the library now
  5.  
  6.     CALL    Output        ;get the defualt STOUT
  7.     Move.L    D0,D1        ;move it into d1 for use by another function
  8.     Beq.S    .NoDOS        ;if there is no handle, then ARGH!
  9.  
  10.     Move.L    #ErrDOS,D2        ;text to type
  11.     Moveq    #46,D3        ;number of character to output
  12.     CALL    Write        ;write the text to the standard out
  13.  
  14. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  15. .NoDOS    Move.L    A6,A1        ;move the library base into A1
  16.     CALL    CloseLibrary,EXEC    ;close it down to keep people happy
  17.  
  18.     Tst.L    _WBMessage        ;were we launched from Workbench?
  19.     Beq.S    .NoWB        ;if not, then don't worry
  20.     CALL    Forbid        ;stop the system dead
  21.     Move.L    _WBMessage(PC),A1    ;take the message from WB
  22.     CALL    ReplyMsg        ;and reply to it, saying we are finished
  23.  
  24. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. .NoWB    Moveq    #RETURN_ERROR,D0    ;fault error returned
  26.     Rts            ;return to the shell/wb
  27.